<?php

namespace Modules\Advert\Database\Seeders;

use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
use Modules\Advert\Entities\Topic;
use Modules\Advert\Entities\TopicItem;

class TopicTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        Model::unguard();
        
        Topic::truncate();
        Topic::insert([
            [
                'merchant_id' => 1,
                'style' => 1,
                'title' => '特价男装',
                'type' => 2,
            ],
            [
                'merchant_id' => 1,
                'style' => 1,
                'title' => '特价女装',
                'type' => 2,
            ],
        ]);

        TopicItem::truncate();
        TopicItem::insert([
            [
                'topic_id' => 1,
                'item_id' => 11,
            ],
            [
                'topic_id' => 1,
                'item_id' => 21,
            ],
            [
                'topic_id' => 1,
                'item_id' => 31,
            ],
            [
                'topic_id' => 1,
                'item_id' => 41,
            ],
            [
                'topic_id' => 1,
                'item_id' => 51,
            ],
            [
                'topic_id' => 1,
                'item_id' => 61,
            ],

            [
                'topic_id' => 2,
                'item_id' => 22,
            ],
            [
                'topic_id' => 2,
                'item_id' => 23,
            ],
            [
                'topic_id' => 2,
                'item_id' => 24,
            ],
            [
                'topic_id' => 2,
                'item_id' => 25,
            ],
            [
                'topic_id' => 2,
                'item_id' => 26,
            ],
            [
                'topic_id' => 2,
                'item_id' => 27,
            ],
        ]);
    }
}
